﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using Microsoft.Practices.Repository;
using DotNetCore.BannerManagement.Domain;

namespace DotNetCore.BannerManagement.DAL.Domain.CountRepositoryArtifacts
{
    /// <summary>
    /// Construct a Count object from a datareader.
    /// </summary>
    internal class GetClickThroughsByAdvertisementIDFactory : IDomainObjectFactory<Count>
    {
        public Count Construct(IDataReader reader)
        {
            Count count = new Count();

            int numberIndex = reader.GetOrdinal("Number");
            if (!reader.IsDBNull(numberIndex))
            {
                count.number = reader.GetInt32(numberIndex);

            }


            return count;
        }
    }
}

